/* 2012-9-14 yzw last manage
*  cookieName,cookieValue,expires,domain,path,secure
*  名称，值，过期时间，域，访问目录，安全性
*
*/
jQuery.cookie = function()
{
	this.Init = function(expires,domain,path,secure)
	{
		this.expires   = expires;
		this.domain	   = domain;
		this.path      = path;
		this.secure    = secure;
	}

	this.Get = function(cookieName)
	{
		var cookies = document.cookie.split('; ');
		var parems = new Object();
		for(var i=0; i< cookies.length; i++)
		{
			var arr = cookies[i].split("=");
			parems[arr[0]] = decodeURI(arr[1]);
		}
		if(cookieName)
		{
			return parems[cookieName];
		}
		return parems;	
	}

	this.Set = function(cookieName,cookieValue)
	{
		var str = cookieName+"="+encodeURI(cookieValue);
		var exp = new Date();
		if(cookieValue)
		{
			exp.setTime(exp.getTime() + this.expires);	
		}else{
			exp.setTime(exp.getTime() -1);	
		}								
		str +="; expires="+exp.toGMTString();	
		str +="; path="+(this.path ? this.path : '/');						
		str +="; domain="+(this.domain ? this.domain : 'youban.com');
		str += this.secure ? "; secure="+this.secure : '';												
		document.cookie = str;
	}

	this.Del = function(cookieName)
	{
		this.Set(cookieName,'');
	}
}
